package com.xzc.one.business.controller.web;

import com.xzc.one.business.pojo.entity.Permission;
import com.xzc.one.business.service.web.PermissionService;
import com.xzc.one.common.inout.ResponseBody;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * author name: xiongzhicong
 * create time: 2020-08-10 17:40:11
 * description: 权限表
 */
@RestController
@RequestMapping("/permission")
public class PermissionController {

    @Autowired
    private PermissionService permissionService;

    @RequestMapping(value = "/insertPermission", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public ResponseBody insertPermission(@RequestBody Permission permission) {
        permissionService.insertPermission(permission);
        return ResponseBody.success("增加成功");
    }

    @RequestMapping(value = "/test", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public ResponseBody test(@RequestBody Permission permission) {

        return ResponseBody.success(permissionService.test());
    }
}
